//
// Created by void on 24-1-13.
//

#ifndef RECTORHTTPSERVER_THREADPOOL_H
#define RECTORHTTPSERVER_THREADPOOL_H

#include "EventLoop.h"
#include <stdbool.h>
#include "WorkerThread.h"

struct ThreadPool {
    struct EventLoop* mainLoop;
    bool isStart;
    int threadNum;
    struct WorkerThread* workerThreads;
    int index;
};

struct ThreadPool* threadPoolInit(struct EventLoop* mainLoop, int count);

void threadPoolRun(struct ThreadPool* pool);

struct EventLoop* takeWorkerEventLoop(struct ThreadPool* pool);

#endif //RECTORHTTPSERVER_THREADPOOL_H
